import request from "@/utils/request.js"

// 获取授权页地址
export function getAuthorizeUrl(data) {
	return request({
		url: '/stock-api/login/authorize',
		method: 'GET',
		data,
	})
}

// code登录
export function codeLogin(data) {
	return request({
		url: '/stock-api/login/wx_account',
		method: 'POST',
		data,
	})
}

// 临时登录
export function tempLogin(data) {
	return request({
		url: '/stock-api/login/tempLogin',
		method: 'POST',
		data,
	})
}

// 刷新客户端token
export function refreshToken(data) {
  return request({
    url: '/stock-api/login/renew_token',
    method: 'post',
		data
  })
}

// 获取用户信息
export function userInfo() {
  return request({
    url: '/stock-api/user/info',
    method: 'GET'
  })
}

// 修改头像昵称
export function updateUserInfo(data) {
  return request({
    url: '/stock-api/user/update',
    method: 'post',
		data
  })
}

// 修改手机号
export function updateMobile(data) {
  return request({
    url: '/stock-api/user/bind_mobile',
    method: 'post',
		data
  })
}
